<template>
    <div>
         <el-input  v-model="search_UID" placeholder="会员UID"></el-input>
         <el-input v-model="search_name" placeholder="会员昵称"></el-input>
          <el-date-picker
              v-model="searchTime"
              type="date"
              placeholder="选择日期"
              format="yyyy - MM - dd"
              value-format="yyyy-MM-dd">
            </el-date-picker>
        <button class="sousuo" @click="search"><i class="el-icon-search"></i></button>
        <template>
            <el-table v-loading="loading" :data="yuEDate" border style="width: 100%">
                <el-table-column prop="uid" label="ID" width="55">
                </el-table-column> 
                <el-table-column prop="date" label="用户信息">
                    <template v-slot="scope">
                        <div class="head_url">
                            <img :src="scope.row.head_url" alt="">
                        </div>
                        <div class="info">
                            <div class="uid">UID: <span>{{ scope.row.uid }}</span></div>
                            <div class="nickname">{{ scope.row.name }}</div>
                        </div>
                    </template>
                </el-table-column>
                <el-table-column prop="name" label="提现魂晶">
                    <template v-slot="scope">
                        {{ format_money(scope.row.withdraw_money) }}
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="提现时间">
                </el-table-column>
                <el-table-column prop="manager" label="经办信息">
                </el-table-column>
            </el-table>
            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pagenum"
                :page-sizes="[8, 10, 15]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper"
                :total="total">
            </el-pagination>
        </template>
    </div>
</template>

<script>
import record from '../../../api/jurisdiction'
import {format_money} from "@/utils/format";
export default {
    data() {
        return {
            yuEDate: [],
            search_UID: null,
            search_name: null,
            searchTime:null,
            loading: true,
            pagesize: 8,
            pagenum: 1,
            total: 0
        }
    },
    created() {
        this.getRecord()
    },
    methods: {
      format_money,
        search() {
          console.log(this.searchTime)
          this.getRecord()
        },
        getRecord() {
            record.hunjingtixian({ page: this.pagenum, page_size: this.pagesize,data:this.searchTime,uid:this.search_UID,name:this.search_name }).then((res) => {
                console.log('魂晶提现记录', res)
                this.yuEDate = res.data.data.list
                this.total = res.data.data.sum_count
                this.loading = false
            }).catch((res) => {
                console.log(res)
                this.$message.warning("请刷新后重试 ")
            })
        },
        handleSizeChange(val) {
            this.pagesize = val
            this.getRecord()
        },
        handleCurrentChange(val) {
            this.pagenum = val
            this.getRecord()
        }
    },
}
</script>

<style lang="less" scoped>
.el-input {
    width: 250px;
    margin-right: 20px;
    margin-bottom: 30px;
}

.sousuo {
    margin: 6px;
    width: 50px;
    height: 40px;
    background: #009688;
    border: 0;
    color: white;
    font-size: 20px;
    vertical-align: middle;
    text-align: center;
    line-height: 40px;
    border-radius: 4px;
    cursor: pointer;
}

.head_url {
    float: left;
    width: 50px;
    height: 50px;
}

.head_url img {
    width: 100%;
    height: 100%;
}

.info {
    float: left;
    width: 120px;
    height: 100%;
    margin-left: 10px;
}

.uid {
    color: red;
    font-size: 12px;
}

.el-pagination {
    text-align: center;
    margin-top: 20px;
}</style>